package com.wkbb.basic.thread;

import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.common.dto.im.GroupUserInfoDto;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author dengjingyuan
 * @date 2019-11-15 09:40
 */
@Slf4j
public class ImSaveAutoMasterTask implements Runnable {

    private TcCloudFeignService tcCloudFeignService;

    private List<GroupUserInfoDto> newGroupUserInfoDtoList;

    private Long orgId;

    private Long classId;

    public ImSaveAutoMasterTask(TcCloudFeignService tcCloudFeignService,List<GroupUserInfoDto> newGroupUserInfoDtoList,Long orgId,Long classId) {
        this.tcCloudFeignService = tcCloudFeignService;
        this.newGroupUserInfoDtoList = newGroupUserInfoDtoList;
        this.orgId = orgId;
        this.classId = classId;

    }

    public ImSaveAutoMasterTask() {

    }

    @Override
    public void run() {
        log.info("*********ImSaveAutoMasterTask********tcCloudFeignService:{},newGroupUserInfoDtoList:{},orgId:{},classId:{}", tcCloudFeignService,newGroupUserInfoDtoList,orgId,classId);
        try {

            tcCloudFeignService.saveMasterGroupUserInfo( newGroupUserInfoDtoList,  classId,  orgId);
        } catch (Exception e) {
            log.error("*******ImSaveAutoMasterTask**********classInfoService:{},saveAutoGroupUserMaster:{}", e);
        }
    }
}